<?php

/**
 * 官网表单
 */

declare(strict_types=1);

namespace app\api\controller;


use think\Controller;
use think\Db;

class Website extends Controller
{
    public function apply()
    {
        $username = $this->request->post('username');
        $mobile = $this->request->post('mobile');
        $address = $this->request->post('address', '');
        $data = [
            "name" => $username,
            "phone" => $mobile,
            "address" => $address,
        ];
        $res = Db::name("website_apply")->insert($data);
        if ($res) {
            echo "提交成功";
        } else {
            echo "提交失败";
        }
    }
}